/*
 * OddEvenSorter.h
 *
 *  Created on:  Jun 12, 2009
 *      Author:  Zach Riggle A37627537
 *      Project: CSE410 Project 2
 */

#ifndef ODDEVENSORTER_H_
#define ODDEVENSORTER_H_

#include <vector>
#include "SafeNumberList.h"

// Even-odd sort
void *evenSort(void*);

// Odd-even sort
void *oddSort(void*);

class OddEvenSorter {
public:
    OddEvenSorter(SafeNumberList *snl);
    virtual ~OddEvenSorter();

    enum Mode {SINGLE_PROCESS, MULTI_PROCESS, MULTI_THREAD};

    void setMode(Mode mode);
    void run();

    string getListAsString();

private:
    void singleProcess();
    void multiProcess();
    void multiThread();

    Mode mode;
    SafeNumberList *snl;
};

#endif /* ODDEVENSORTER_H_ */
